@extends('admin.index')
@section('title','问题反馈')
 @section('con')
  <script src="{{asset('homeCSS\dist\js\jquery-1.12.4.min.js')}}"></script> 
 <div class="panel-body">
     <div class="dataTable_wrapper">
         <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
      <div class="row">
       <div class="col-sm-12">
         <table id="dataTables-example" class="table table-striped table-bordered table-hover dataTable no-footer" role="grid" aria-describedby="dataTables-example_info">
             <thead>
                 <tr role="row">
                 <th class="sorting_asc" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 100px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">ID</th>
                 <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 100px;" aria-label="Browser: activate to sort column ascending">反馈信息</th>
                 <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 165px;" aria-label="Platform(s): activate to sort column ascending">图片</th>
                 <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 134px;" aria-label="Engine version: activate to sort column ascending">联系方式</th>
                 <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 96px;" aria-label="CSS grade: activate to sort column ascending">页面地址</th>
                 <th class="sorting" tabindex="0" aria-controls="dataTables-example" rowspan="1" colspan="1" style="width: 96px;" aria-label="CSS grade: activate to sort column ascending">操作</th>
                 </tr>
             </thead>
             <tbody>
             @foreach($proposal as $k=>$v)
                <tr class="gradeA odd" role="row">
                     <td class="sorting_1">{{$v->id}}</td>
                     <td>{{$v->content}}</td>
                     <td>
                    <img name='bbb' id="bbb"  src="{{$v->img}}" style="width:100px;height:100px;" />
                      
                      </td>
                     <td>{{$v->phone}}</td>
                     <td class="center">{{$v->url}}</td>
                     <td><a href="" class='delUser' sid='{{$v->id}}'>删除</a></td>
                </tr>
             @endforeach  
            </tbody>
         </table>
     </div>
    </div>
         <div class="row">
             <div class="col-sm-6">
                 <!-- <div class="dataTables_info" id="dataTables-example_info" role="status" aria-live="polite">Showing 1 to 25 of 57 entries</div> -->
             </div>
             <div class="col-sm-6">
              {!! $proposal->appends($all)->render() !!}
             </div>
         </div>
         </div>
     </div>
 </div>
 @endsection
 @section('js')
    <script type="text/javascript">
        $('.delUser').click(function(){
            //获取id
            var id = $(this).attr('sid');
            var bb = $(this);
             $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
                });
            //发送post请求
            $.post('/admin/proposal/prdel',{id:id},function(data){
                if(data == 1){
                    //删除单条信息
                    bb.parents('tr').remove();
                    //获取提醒信息
                    $('#successMessage').text('删除成功').show(1000);
                        //定时关闭消息
                        setTimeout(function(){
                            $('#successMessage').hide(1000);
                        },2000);
                }
            });
            return false;
        })
    </script>
 @endsection
 

